package com.anXin.model.mall.pojos;

import com.anXin.model.util.ListToVarcharTypeHandler;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@TableName(value = "anxin_mall_goods", autoResultMap = true)
public class Goods {
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableId(value = "id",type = IdType.ID_WORKER)
    private Long id;

    /**
     * 标题
     */
    @TableField("title")
    private String title;

    /**
     * 轮播图
     */
    @TableField(value = "slide",typeHandler = ListToVarcharTypeHandler.class)
    private List<String> slide;

    /**
     * 缩略图，封面
     */
    @TableField("image")
    private String image;

    /**
     * 价格
     */
    @TableField("price")
    private double price;

    /**
     * 已售
     */
    @TableField("quantity")
    private int quantity;

    /**
     * 库存
     */
    @TableField("amount")
    private int amount;

    /**
     * 描述markdown
     */
    @TableField("content")
    private String content;


    @TableField(fill = FieldFill.INSERT)
    private Date createdTime;


}
